<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>凡客-详情页</title>
		<link rel="stylesheet" type="text/css" href="<?php echo __PUBLIC__?>/Home/org/bootstrap-3.3.5-dist/css/bootstrap.min.css" />
		<script src="<?php echo __PUBLIC__?>/Home/js/jquery-1.7.2.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="<?php echo __PUBLIC__?>/Home/org/bootstrap-3.3.5-dist/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>

		<link rel="stylesheet" type="text/css" href="<?php echo __PUBLIC__?>/Home/css/description.css" />
	</head>
	<body>
		<!--顶部灰色区域-->
		<div id="top">
			<div class="header">
				<div class="header_left">
					<div class="welcome">
			            您好,
			            			            欢迎光临凡客诚品！
			            <span><a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=Login&a=login">登录</a> | <a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=Register&a=register">注册</a></span>
			            
               			            </div>
					<div class="collect">
												<a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=Login&a=login">我的订单</a>
						
               						<a href="">收藏本站</a>
					</div>
				</div>
				<div class="header_right">
					<ul>
						<li>
							<a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=Member&a=index">我的凡客<span></span></a>
							<div class="listBox">
								<a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=Member&a=index">我的凡客<span></span></a>
								<ul style="clear: both;">
									<li><a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=Member&a=dingdan">我的订单</a></li>
									<li><a href="">我的收藏</a></li>
								</ul>
							</div>
						</li>
						<li>
							<a href="">帮助中心<span></span></a>
							<div class="listBox">
								<a href="">帮助中心<span></span></a>
								<ul>
									<li><a href="">购物指南</a></li>
									<li><a href="">配送方式</a></li>
									<li><a href="">支付方式</a></li>
									<li><a href="">售后服务</a></li>
									<li><a href="">投诉建议</a></li>
									<li><a href="">在线客服</a></li>
								</ul>
							</div>
						</li>
						<li>
							<a href="">网站公告<span></span></a>
							<div class="listBox">
		                        <a href="">网站公告<span></span></a>
		                        <ul>
		                            <li><a href="">春节公告</a></li>
		                            <li><a href="">网站公告</a></li>
		                            <li><a href="">重要提示</a></li>
		                        </ul>
		                    </div>
						</li>
						<li><a href="">手机凡客<span class="tel"></span></a></li>
						<li><a href="">在线客服<span class="line"></span></a></li>
					</ul>
					<a href="" class="weibo"></a>
					<a href="" class="weixin"></a>
				</div>
			</div>
		</div>
		<!--顶部灰色区域结束-->
		<!--搜索区域-->
		<script type="text/javascript">
        $(function(){
            $(document).on("mouseenter", ".carttop", function(){ 
                // alert(1);
                $.ajax({
                    url: 'http://localhost/PersonalShow/php/shop/index.php?m=Home&c=Index&a=ajaxCart',
                    type: 'POST',
                    dataType: 'json',
                    data: {param1: 'value1'},
                    success:function(arr){
                        console.log(arr);
                        if(arr.goods.length!=0){
                            tr = '<a href="index.php?m=Home&c=car&a=index" class="carttop">购物车（'+arr.total_rows+'）</a><div class="index_2"></div><div class="index_1">最近加入的商品：<br /><ul>';
                            $.each(arr.goods, function(k, v) {
                                tr += '<li><input type="hidden" name="gid" value="'+k+'" /><div><img src="'+v.pic+'" alt="" /></div><div><a href="index.php?m=Home&c=Desc&a=index&gid='+v.id+'" class="gname">'+v.name+'&nbsp;';
                                    $.each(v.options, function(kk, vv) {
                                        tr += vv;
                                    });
                                tr += '</a><p class="price"> ￥'+v.price+'×'+v.num+'</p></div><div class="gdel"><a href="javascript:;" class="cardel">删除</a></div></li>';
                            });
                            tr += '</ul><div class="total"><p>共计(未计算促销折扣)<br />￥'+arr.total+'</p><a href="index.php?m=Home&c=car&a=index" class="showcart">查看购物车（'+arr.total_rows+'）</a></div></div>';
                            $('.shoppingcart').html(tr);
                        }else{
                            tr = '<a href="index.php?m=Home&c=car&a=index" class="carttop">购物车（0）</a><div class="index_2"></div><div class="index_1">您的购物车中没有任何商品</div>';
                            $('.shoppingcart').html(tr);
                        }
                    }
                })
            });
        })
        // 异步删除购物车中的商品
        // 高版本下不支持live事件  用on代替
        $(function(){
            $(document).on("click", ".cardel", function(){ 
                var _this=$(this);
                // alert(1);
                // 获得商品序号
                var gid = $(this).parents('li').find('input[name=gid]').val();
                // alert(gid);
                $.ajax({
                    url: 'http://localhost/PersonalShow/php/shop/index.php?m=Home&c=Index&a=ajaxDel',
                    type: 'POST',
                    dataType: 'json',
                    data: {gid: gid},
                    success:function(arr){
                        if(arr.total!=0){
                            tr = '购物车（'+arr.total+'）';
                            $('.shoppingcart .carttop').text(tr);
                            $('.shoppingcart .total').html('<p>共计(未计算促销折扣)<br />￥'+arr.total+'</p><a href="index.php?m=Home&c=car&a=index" class="showcart">查看购物车（'+arr.total_rows+'）</a>')
                            _this.parents('li').remove();
                        }else{
                            tr = '<a href="index.php?m=Home&c=car&a=index" class="carttop">购物车（0）</a><div class="index_2"></div><div class="index_1">您的购物车中没有任何商品</div>';
                            $('.shoppingcart').html(tr);
                        }
                    }
                })
            });
        })
    </script>
		<div id="seek">
			<div class="logo">
				<a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=Index&a=index"></a>
			</div>
			<div class="search_">
				<div class="searchTab">
					<form action="" method="post">
						<input type="text" class="searchTab_1" placeholder="搜“羽绒服”，体验与众不同" />
						<input type="submit" value="" class="searchTab_2" />
					</form>
					<div class="shoppingcart">
                                    <a href="index.php?m=Home&c=car&a=index" class="carttop">购物车（0）</a>
                    <div class="index_2"></div>
                    <div class="index_1">您的购物车中没有任何商品</div>
                
                           </div>
				</div>
				<div class="searchText">
					热门搜索：<a href="">羽绒服</a><a href="">外套</a><a href="">衬衫</a><a href="">针织衫</a><a href="">帆布鞋</a>
				</div>
			</div>
		</div>
		<!--搜索区域结束-->
		<!--导航条-->
		<div id="menu">
			<div class="all" style="position: relative;">全部商品分类
				<span></span>
				<div class="all_menu">

				<!-- 控制单独样式 -->
		        <script type="text/javascript">
		            $(function(){
		                $('.all_menu div dl dd a:first-child').removeClass('index');
		            })
		        </script>
				<!-- 男装 女装 -->
										<div>
					<dl>
						<h4><a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=1" target="_blank">男装</a></h4>
													<dt><a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=4" target="_blank">衬衫</a></dt>
							<dd>
																<a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=9" target="_blank" class="index">免烫</a>
																<a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=10" target="_blank" class="index">法兰绒</a>
																<a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=11" target="_blank" class="index">牛仔布</a>
																<a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=12" target="_blank" class="index">牛津纺</a>
															</dd>
													<dt><a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=5" target="_blank">针织衫</a></dt>
							<dd>
																<a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=13" target="_blank" class="index">羊毛衫</a>
																<a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=14" target="_blank" class="index">羊绒衫</a>
																<a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=15" target="_blank" class="index">棉线衫</a>
															</dd>
													<dt><a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=6" target="_blank">外套</a></dt>
							<dd>
																<a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=16" target="_blank" class="index">羽绒服</a>
																<a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=17" target="_blank" class="index">冲锋衣</a>
																<a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=18" target="_blank" class="index">羊毛外套</a>
																<a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=19" target="_blank" class="index">卫衣</a>
															</dd>
													<dt><a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=7" target="_blank">裤装</a></dt>
							<dd>
																<a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=20" target="_blank" class="index">牛仔裤</a>
																<a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=21" target="_blank" class="index">休闲裤</a>
																<a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=22" target="_blank" class="index">运动裤</a>
															</dd>
											</dl>
					</div>
										<div>
					<dl>
						<h4><a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=2" target="_blank">女装</a></h4>
													<dt><a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=8" target="_blank">上装</a></dt>
							<dd>
																<a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=24" target="_blank" class="index">羽绒服</a>
																<a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=25" target="_blank" class="index">针织衫</a>
																<a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=26" target="_blank" class="index">卫衣</a>
																<a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=27" target="_blank" class="index">羊毛大衣</a>
															</dd>
													<dt><a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=23" target="_blank">裤装</a></dt>
							<dd>
																<a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=28" target="_blank" class="index">牛仔裤</a>
																<a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=29" target="_blank" class="index">运动裤</a>
																<a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=30" target="_blank" class="index">打底裤</a>
															</dd>
											</dl>
					</div>
									<!-- 鞋袜 -->
					<div>
					<dl>
						<h4>
											            <a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=31" target="_blank" style="float:left;">鞋/</a>
				            				            <a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=32" target="_blank" style="float:left;">家居/</a>
				            				            <a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=33" target="_blank" style="float:left;">袜品/</a>
				            				            <a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=34" target="_blank" style="float:left;">内衣/</a>
				            						</h4>
						<dd>
											            <a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=31" target="_blank" class="index">鞋</a>
				            				            <a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=32" target="_blank" class="index">家居</a>
				            				            <a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=33" target="_blank" class="index">袜品</a>
				            				            <a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=34" target="_blank" class="index">内衣</a>
				            						</dd>
					</dl>
					</div>
				</div>	
			</div>
			<ul>
								<li>
					<a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=12" class="fir_menu">牛津纺</a>
					<div class="sec_menu">
												<div class="sec_menu_clo">
							<img src="Upload/img/160308/6391457437399.jpg" />
							<h3><a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=Desc&a=index&gid=6">凡客衬衫 牛津纺 吉国武 男款</a></h3>
							<span>￥199</span>
						</div>
						<div class="sec_menu_line"></div>
												<div class="sec_menu_clo">
							<img src="Upload/img/160308/46001457437841.jpg" />
							<h3><a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=Desc&a=index&gid=7">凡客衬衫 牛津纺 男款</a></h3>
							<span>￥149</span>
						</div>
						<div class="sec_menu_line"></div>
											</div>
				</li>
								<li>
					<a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=15" class="fir_menu">棉线衫</a>
					<div class="sec_menu">
												<div class="sec_menu_clo">
							<img src="Upload/img/160310/95741457571535.jpg" />
							<h3><a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=Desc&a=index&gid=8">凡客棉线衫 圆领 男款</a></h3>
							<span>￥149</span>
						</div>
						<div class="sec_menu_line"></div>
												<div class="sec_menu_clo">
							<img src="Upload/img/160310/64301457580909.jpg" />
							<h3><a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=Desc&a=index&gid=14"> 凡客棉线衫 开衫 男款</a></h3>
							<span>￥199</span>
						</div>
						<div class="sec_menu_line"></div>
											</div>
				</li>
								<li>
					<a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=16" class="fir_menu">羽绒服</a>
					<div class="sec_menu">
												<div class="sec_menu_clo">
							<img src="Upload/img/160310/32371457581956.jpg" />
							<h3><a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=Desc&a=index&gid=15">凡客羽绒服 匈牙利鹅绒 男款</a></h3>
							<span>￥499</span>
						</div>
						<div class="sec_menu_line"></div>
												<div class="sec_menu_clo">
							<img src="Upload/img/160310/82101457590938.jpg" />
							<h3><a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=Desc&a=index&gid=16">超轻暖连帽羽绒服 男款</a></h3>
							<span>￥149</span>
						</div>
						<div class="sec_menu_line"></div>
											</div>
				</li>
								<li>
					<a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=18" class="fir_menu">羊毛外套</a>
					<div class="sec_menu">
												<div class="sec_menu_clo">
							<img src="Upload/img/160310/95481457592017.jpg" />
							<h3><a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=Desc&a=index&gid=18">凡客羊毛大衣 连帽绳扣</a></h3>
							<span>￥699</span>
						</div>
						<div class="sec_menu_line"></div>
												<div class="sec_menu_clo">
							<img src="Upload/img/160311/4021457680488.jpg" />
							<h3><a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=Desc&a=index&gid=21">凡客羊毛大衣 双排扣</a></h3>
							<span>￥799</span>
						</div>
						<div class="sec_menu_line"></div>
											</div>
				</li>
								<li>
					<a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=19" class="fir_menu">卫衣</a>
					<div class="sec_menu">
												<div class="sec_menu_clo">
							<img src="Upload/img/160310/72671457592471.jpg" />
							<h3><a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=Desc&a=index&gid=19">凡客卫衣 连帽开衫 男款</a></h3>
							<span>￥199</span>
						</div>
						<div class="sec_menu_line"></div>
												<div class="sec_menu_clo">
							<img src="Upload/img/160310/42941457592758.jpg" />
							<h3><a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=Desc&a=index&gid=20">Vancl by Scott 男款 长袖 卫衣 CM1750</a></h3>
							<span>￥279</span>
						</div>
						<div class="sec_menu_line"></div>
											</div>
				</li>
								<li>
					<a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=27" class="fir_menu">羊毛大衣</a>
					<div class="sec_menu">
												<div class="sec_menu_clo">
							<img src="Upload/img/160311/9661457684439.jpg" />
							<h3><a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=Desc&a=index&gid=32">凡客手工大衣 连帽长款大衣 女款</a></h3>
							<span>￥499</span>
						</div>
						<div class="sec_menu_line"></div>
												<div class="sec_menu_clo">
							<img src="Upload/img/160311/82621457684811.jpg" />
							<h3><a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=Desc&a=index&gid=33">凡客手工大衣 立领短大衣 女款</a></h3>
							<span>￥399</span>
						</div>
						<div class="sec_menu_line"></div>
											</div>
				</li>
								<li>
					<a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=List&a=index&cid=28" class="fir_menu">牛仔裤</a>
					<div class="sec_menu">
												<div class="sec_menu_clo">
							<img src="Upload/img/160311/32211457686029.jpg" />
							<h3><a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=Desc&a=index&gid=34">凡客牛仔裤 轻弹 弹力紧身 女款</a></h3>
							<span>￥149</span>
						</div>
						<div class="sec_menu_line"></div>
												<div class="sec_menu_clo">
							<img src="Upload/img/160311/58441457686277.jpg" />
							<h3><a href="http://localhost/PersonalShow/php/shop/index.php?m=Home&c=Desc&a=index&gid=35">凡客牛仔裤 中腰短裤 女款</a></h3>
							<span>￥129</span>
						</div>
						<div class="sec_menu_line"></div>
											</div>
				</li>
								<li><a href="" class="fir_menu">特惠频道</a></li>
			</ul>
		</div>
		<!--导航条结束-->
		<!--详情部分-->
			<!--选择商品属性-->
		<div id="shopping">
			<div class="title">
				<p>
					<a href="<?php echo U('Index/index')?>">首页 </a> > 
					<?php foreach ($cateData as $k=>$v){?>
					<a href="<?php echo U('List/index',array('cid'=>$v['cid']))?>"> <?php echo $v['cname']?> </a> > 
					<?php }?>
					<?php echo $goodsData['gname']?>
				</p>
			</div>
			<div class="middle">
				<h2><p style="float:left;margin-right:10px;"><?php echo $goodsData['gname']?></p> <span></span></h2>
				<div>
					<a href="">产品描述</a>|
					<a href="">评论</a>|
					<a href="">提问</a>
				</div>
			</div>	
			<div class="main">
				<div class="small">
					<!-- hover改变图片地址 -->
					<script type="text/javascript">
						$(function(){
							// 默认设置
							$('.box_tab li').first().addClass('index');
							var src = $('.box_tab li').first().find('img').attr('src');
							$('.middling .mid_img').attr('src', src);
							$('.middling .big_img').attr('src',src);
							// hover设置
							$('.box_tab li').hover(function(){
								var x = $(this).index();
								$(this).addClass('index').siblings('li').removeClass('index');
								var src = $('.box_tab li').eq(x).find('img').attr('src');
								$('.middling .mid_img').attr('src', src);
								$('.middling .big_img').attr('src',src);
							})
						})
					</script>
					<style type="text/css">
						.box_tab li img{
							width: 66px;
							height: 66px;
						}
					</style>
						<!-- 单击控制ul -->
						<script type="text/javascript">
							$(function(){
								var num = $('.box_tab li').length;
								if (num <= 5) return;
								var x = 0;
								$('.up').click(function(){
									if (x==0) return;
									x--;
									$('.box_tab').animate({'top': -81*x+'px'}, 300);
								})
								$('.down').click(function(){
									if (x==num-5) return;
									x++;
									$('.box_tab').animate({'top': -81*x+'px'}, 300);
								})
							})
						</script>
					<div class="up"></div>
					<div class="box">
						<ul class="box_tab">
							<?php foreach ($goodsData['img'] as $kimg=>$vimg){?>
							<li><span><img src="<?php echo $vimg?>" alt=""></span></li>
							<?php }?>
						</ul>
					</div>
					
					<div class="down"></div>
				</div>

				<!-- 放大镜 -->
				<script type="text/javascript">
					$(function(){
						$('#cover').mousemove(function(e){
							$('.big').css('display', 'block');
							//获得事件对象
							var ev = window.event || e;
							//获得鼠标的位置
							var mouse_left = ev.offsetX || ev.layerX;
							var mouse_top = ev.offsetY || ev.layerY;
									
							//计算白块的位置
							var box_left = mouse_left-100;
							var box_top = mouse_top-100;
									
							if(box_left<0){
								box_left=0;
							}
							if(box_top<0){
								box_top=0;
							}
							if(box_left>200){
								box_left=200;
							}
							if(box_top>200){
								box_top=200;
							}
							//将值赋值给小白块
							box.style.left = box_left+'px';
							box.style.top = box_top+'px';
									
							//计算右侧大图的位置
							var rpic_left = box_left*-2;
							var rpic_top = box_top*-2;
							//给大图赋值
							$('.big img').css({
								'top': rpic_top+'px',
								'left': rpic_left+'px'
							});
						})
						$('#cover').mouseout(function(event) {
							$('.big').css('display', 'none');
						});
					})
				</script>

				<div class="middling">
					<img src="" class="mid_img" style="width:400px;height:400px;" />
					<div id="box"></div>
					<div id="cover"></div>
					<div class="big">
						<img src="" class="big_img" style="width:800px;height:800px;" />
					</div>
				</div>
				

				<div class="choose">
					<div class="price">
						<p>市场价：<span style="text-decoration:line-through;">￥<?php echo $goodsData['mprice']?></span> 售价：<span>￥</span><strong><?php echo $goodsData['sprice']?></strong></p>
					</div>
					<div class="selectArea">
						<script type="text/javascript">
							$(function(){
								// 判断是否发送异步
								var num = $('.color').length;

								// 判断价格
								var price = $('.price p strong').text();
								var newprice = 0;

								$('.color_tab li').click(function(){
									// <!-- tab切换 -->
									$(this).addClass('index').siblings('li').removeClass('index');
									$(this).parents('.color').find('.shop_tips').css('display', 'none');;

									// 判断价格
									var x = 0;
									$.each($('.color .index'), function(k, v) {
										x = x + parseInt($(this).find('p').attr('addprice'));
									});
									newprice = x + parseInt(price);
									$('.price p strong').html(newprice);

									// 异步
									var remote = {'gid':'','combine':''};
									$.each($('.color .index'), function(k, v) {
										remote.combine += $(this).find('p').attr('gaid')+'|';
										remote.gid = $(this).find('p').attr('gid');
									});

									if($('.color .index').length!=num) return;
									// 异步 类型
									$.ajax({
										url: '<?php echo U('ajaxType')?>',
										type: 'POST',
										dataType: 'json',
										data: {remote: remote},
										success:function(arr){
											// console.log(arr);
											// 判断库存是否为空
											if(!arr){
												$('.s_size').html('');
												$('.s_total').html('抱歉！该货品已售空！');
												$('.shoppingBuy').css('display', 'none');
											}else{
												if(parseInt(arr.glstock)<=10){
													// 库存紧张
													$('.s_total').html('库存紧张');
													var tr = '';
													for (var i = 1; i <= parseInt(arr.glstock); i++) {
														tr += '<option value="'+i+'">'+i+'</option>'
													};
													// alert(tr);
													$('.num select').html(tr);
												}else{
													// 库存充足
													$('.s_total').html('现在有货');
													var tr = '';
													for (var i = 1; i <= 10; i++) {
														tr += '<option value="'+i+'">'+i+'</option>'
													};
													$('.num select').html(tr);
												}
												// 购买框是否显示
												$('#hide_glid').html('<input type="hidden" name="glid" value="'+arr.glid+'">');
												$('.s_size').html(arr.glstock);
												$('.shoppingBuy').css('display', 'block');
											}
										}
									})
								})
								
								$('.color').first().find('.color_tab li .bg').prepend('<span></span>');
								$('.color').first().find('.color_tab li').first().addClass('index');

								// 获取货品标题 颜色  默认
								var color = $('.color').first().find('p').eq(0).text();
								$('#shopping .middle h2 span').html(color);
								$('#shopping .select .s_color').html(color);

								// 单击事件后   标题
								$('.color').first().find('li').click(function() {
									var color = $(this).find('p').text();
									$('#shopping .middle h2 span').html(color);
								});

								// 单击事件 颜色 尺寸 select
								$('.color li').click(function() {
									var size = '';
									$.each(($('.color .index')), function(k, v) {
										 size += $(this).find('p').text()+"&nbsp;";
									});
									$('#shopping .select .s_color').html(size);
								});

							})
						</script>
						<?php foreach ($typeData as $k=>$v){?>
						<div class="color" style="float:left;">
							<span class="col_name"><?php echo $k?>：</span>
							<ul class="color_tab">
								<?php foreach ($v as $kk=>$vv){?>
								<li>
									<div class="bg">
										<p addprice="<?php echo $vv['addprice']?>" gaid="<?php echo $vv['gaid']?>" gid="<?php echo $vv['goods_gid']?>"><?php echo $vv['gavalue']?></p>
										<div></div>
									</div>
								</li>
								<?php }?>
							</ul>
							<div class="shop_tips"><span></span><p>请选择您要购买的商品<?php echo $k?> </p></div>
						</div>
						<?php }?>

						
						<div class="num">
							数量：
							<select name="">
								
							</select>
							<span>余量有限</span>
						</div>
						<div class="select">
							已选：
							<span class="s_color"></span>，
							<span class="s_size"></span>
							<span class="s_total"></span>
						</div>
						<div class="shoppingBuy">
							<a href="javascript:;" class="buy">立即购买</a>
							<a href="javascript:;" class="car"></a>
						</div>

					<!-- 立即购买 -->
					<script type="text/javascript">
						$(function(){
							$('.buy').click(function() {
								// 声明数组
								var shopgoods = {'id':'','num':0,'options':{}}

								// 判断规格是否选择完全
								var y = 1;
								$.each($('.color'), function(k, v) {
									// 判断提示框
									var x = $(this).find('.index').index();
									if(x<0){
										$(this).find('.shop_tips').css('display', 'block');
										y = 0;
									}
								// 添加规格
								shopgoods.options[$(this).find('.index .bg p').attr('gaid')] = $(this).find('.index .bg p').text();
								});
								// 规格选择不全  div显示
								if(y==0) return;

								// 添加其他属性
								shopgoods.id = $('.color .bg p').attr('gid');
								shopgoods.num = $('.num select').val();
								// shopgoods.options['pic'] =  
								// console.log(shopgoods);
								// 发送异步
								$.ajax({
									url: '<?php echo U('ajaxGoods')?>',
									type: 'POST',
									dataType: 'json',
									data: {shopgoods: shopgoods},
									success:function(arr){
										if(arr){
											window.location.href='<?php echo U('Car/index')?>';
										}
									}
								})
							});
						})
					</script>

					<!-- 弹窗 控制弹窗显隐    以及发送异步存入session-->
					<script type="text/javascript">
						$(function(){
							$('.car').click(function(){
								// 声明数组
								var shopgoods = {'id':'','num':0,'options':{}}

								// 判断规格是否选择完全
								var y = 1;
								$.each($('.color'), function(k, v) {
									// 判断提示框
									var x = $(this).find('.index').index();
									if(x<0){
										$(this).find('.shop_tips').css('display', 'block');
										y = 0;
									}
									// 添加规格
									shopgoods.options[$(this).find('.index .bg p').attr('gaid')] = $(this).find('.index .bg p').text();
								});
								// 规格选择不全  div显示
								if(y==0) return;

								// 添加其他属性
								shopgoods.id = $('.color .bg p').attr('gid');
								shopgoods.num = $('.num select').val();
								// shopgoods.options['pic'] =  
								// console.log(shopgoods);
								// 发送异步
								$.ajax({
									url: '<?php echo U('ajaxGoods')?>',
									type: 'POST',
									dataType: 'json',
									data: {shopgoods: shopgoods},
									success:function(arr){
										// console.log(arr);
										$('.popup .total-pic .shop_num').html(arr.total_rows);
										$('.popup .total-pic .shop_price').html(arr.total);
										// 弹窗显示
										$('.popup').css('display', 'block');
									}
								})


								// 弹窗中的标题
								var title = $('#shopping .middle h2').text();
								$('.popup p').html(title);
							})
							$('.gwc-close,.guang').click(function(){
								// 弹窗隐藏
								$('.popup').css('display', 'none');
							})
						})
					</script>
						<div class="popup">
							<div class="sign"></div>
							<p></p>
							<div class="add-success">成功加入购物车!</div>
							<div class="total-pic">
								购物车中共<span class="shop_num"></span>  件商品，金额合计 
								￥<span style="font-size:20px;font-weight:700;" class="shop_price"></span>
							</div>
							<div class="pro-bottom">
								<a href="javascript:;" class="guang"><< 继续逛逛</a>
								<a href="<?php echo U('Car/index')?>" class="jiesuan">去购物车 >></a>
							</div>
							<a href="javascript:;" class="gwc-close" title="关闭"></a>
						</div>
						<!-- 弹窗end -->
					</div>
				</div>
			</div>
		</div>
		
		
			<!--温馨提示-->
		<!-- <div id="tips">
			温馨提示: [售后服务]该商品属于特殊商品，不支持7天无理由退换货。 
		</div> -->
			<!--商品详情-->
		<div id="description">
			<h3>产品描述：</h3>
			<p>高端正装衬衫。原料使用新疆阿瓦提长绒棉。面料为中国面料制造商盛泰集团打造的300支四股面料，代表当今中国棉纺较高工艺。成衣缝制由日本衬衫专家吉国武先生监制，代表日本较高衬衫缝制工艺。 </p>
			<h3>产品属性：(点击属性可查看同类商品)</h3>
			<ul>
				<?php foreach ($attr as $k=>$v){?>
				<li title="点击查看同类商品">
					<span><?php echo $v['taname']?>：</span>
					<a href="javascript:;"><?php echo $v['gavalue']?></a>
				</li>
				<?php }?>
			</ul>
			<h3>洗涤说明</h3>
			<div class="washing">
				<img src="<?php echo __PUBLIC__?>/Home/images/Image 1.jpg"/>
			</div>
			<h3>详情图片：</h3>
			<h3 style="font-weight: normal;margin: 0;"> 注： 商品实际颜色以静物图为准 </h3>
			<div class="shop_pic">
				<?php echo $goodsData['intro']?>
			</div>
			<h3>售后服务：</h3>
			<div class="shop_pic">
				<?php echo $goodsData['service']?>
				
			</div>
		</div>
		<!--详情部分结束-->
		
		
		<!--评论区域-->
		<div id="comment">
			<div class="hot">
				<h2>热销产品</h2>
				<ul>
					<li>
						<img src="<?php echo __PUBLIC__?>/Home/images/6373571-1j201511061140350380.jpg"/>
						<a href="">凡客羽绒服 匈牙利鹅绒 男款 黑色</a>
						<p>售价￥999</p>
					</li>
					<li>
						<img src="<?php echo __PUBLIC__?>/Home/images/6373571-1j201511061140350380.jpg"/>
						<a href="">凡客羽绒服 匈牙利鹅绒 男款 黑色</a>
						<p>售价￥999</p>
					</li>
					
				</ul>
			</div>
			<div class="comment">
				<h2>最新评论(共2条)</h2>
				<div class="pl"><span>我要评论</span></div>
				<ul>
					<li>
						<div class="left">
							<p class="content">质量很好很舒适</p>
							<p class="time">2015/12/28 12:30:10</p>
						</div>
						<div class="middle">
							<span>颜色：白色</span>
							<span>尺码：39</span>
							<span>身高：0cm</span>
							<span>体重：0.0kg</span>
							<span><尺码合适></span>
						</div>
						<div class="right">
							<a href="">1381*****82</a>
							<p><span></span></p>
						</div>
					</li>
					<li>
						<div class="left">
							<p class="content">质量很好很舒适</p>
							<p class="time">2015/12/28 12:30:10</p>
						</div>
						<div class="middle">
							<span>颜色：白色</span>
							<span>尺码：39</span>
							<span>身高：0cm</span>
							<span>体重：0.0kg</span>
							<span><尺码合适></span>
						</div>
						<div class="right">
							<a href="">1381*****82</a>
							<p><span></span></p>
						</div>
					</li>
				</ul>
			</div>
			<!--<div class="question">
				
			</div>-->
		</div>
		
		
		<!--评论区域结束-->
		<!--网页底部-->
		<div id="footer">
    <ul>
        <li>
            <h2>关于凡客</h2>
            <p><a href="">公司简介</a></p>
            <p><a href="">联系我们</a></p>
            <p><a href="">友情链接</a></p>
        </li>
        <li>
            <h2>新手指南</h2>
            <p><a href="">账户注册</a></p>
            <p><a href="">购物流程</a></p>
            <p><a href="">网站地图</a></p>
        </li>
        <li>
            <h2>配送时间及时间</h2>
            <p><a href="">国内配送</a></p>
            <p><a href="">订单拆分</a></p>
        </li>
        <li>
            <h2>支付方式</h2>
            <p><a href="">货到付款</a></p>
            <p><a href="">在线支付</a></p>
            <p><a href="">礼品卡及账户余额</a></p>
            <p><a href="">其他支付方式</a></p>
        </li>
        <li>
            <h2>售后服务</h2>
            <p><a href="">退换货政策</a></p>
            <p><a href="">退换货办理流程</a></p>
            <p><a href="">退换货网上办理</a></p>
            <p><a href="">退款说明</a></p>
        </li>
        <li style="border: none;">
            <h2>帮助中心</h2>
            <p><a href="">在线客服</a></p>
            <p><a href="">找回密码</a></p>
            <p><a href="">隐私声明</a></p>
        </li>
    </ul>
</div>
		<div id="footer_bg">
			<ul>
				<li>
					<a href="javascript:;" class="index_1"></a>
				</li>
				<li>
					<a href="javascript:;" class="index_2"></a>
				</li>
				<li>
					<a href="javascript:;" class="index_3"></a>
				</li>
				<li>
					<a href="javascript:;" class="index_4"></a>
				</li>
			</ul>
		</div>
		<!--网页底部结束-->
		<!--网页结束-->
		<div id="bottom">
			<p>Copyright 2007 - 2016 vancl.com All Rights Reserved 出版物经营许可证新出发京批字第直xxxxx号</p>
			<div>
				<a href="javascript:;" class="index_1"></a>
				<a href="javascript:;" class="index_2"></a>
				<a href="javascript:;" class="index_3"></a>
				<a href="javascript:;" class="index_4"></a>
				<a href="javascript:;" class="index_5"></a>
				<a href="javascript:;" class="index_6"><img src="http://localhost/PersonalShow/php/shop/Public/Home/images/kexin_brand_for_others.png" alt="" /></a>
			</div>
		</div>

        <!-- 返回顶部js -->
        <script type="text/javascript">
            $(function() {
                $(window).scroll(function(){
                    var scrolltop=$(this).scrollTop();      
                    if(scrolltop>=200){     
                        $(".toolbar").show();
                    }else{
                        $(".toolbar").hide();
                    }
                });     
                $(".toolbar-item-top").click(function(){
                    $("html,body").animate({scrollTop: 0}, 600);    
                });     
                
            })
        </script>
		<!--返回顶部-->
		<div class="toolbar" style="display:none;">
           <a href="###" class="toolbar-item toolbar-item-weixin">
           <span class="toolbar-layer"></span>
           </a>
           <a href="###" class="toolbar-item toolbar-item-feedback"></a>
           <a href="###" class="toolbar-item toolbar-item-app">
            <span class="toolbar-layer"></span>
           </a>
           <a href="javascript:;" class="toolbar-item toolbar-item-top"></a>
        </div>		
	</body>
</html>
